package cn.gson.crm.controller.studentdetail;
import java.util.List;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.StudentDetailDao;
import cn.gson.crm.model.entity.StudentDetail;


/**
 * Servlet implementation class NopayedServlet
 */
@WebServlet("/nopayed")
public class NopayedServlet extends BaseServlet {
	/**
	 * 未缴清学费学员
	 */
	private static final long serialVersionUID = 1L;
    private StudentDetailDao studentpayDao = new StudentDetailDao();
    @Override
	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String p = request.getParameter("page");
		String name = request.getParameter("name");
		if (p== null ||p.isEmpty()) {
			p = "1";
		}
		Integer page = Integer.parseInt(p);
		//获取未缴清学费学员
		List<StudentDetail> stuList = studentpayDao.getStudentList(page, "正常", "已分配", name, 1);
		int totalPage =  studentpayDao.getTotalPage("正常", "已分配", name, 1);
		request.setAttribute("page", page);
		request.setAttribute("stuList", stuList);
		request.setAttribute("totalPage", totalPage);
		request.setAttribute("queryString", noPageQueryString(request));
		getServletPathAndForward(request, "student/paystatus.jsp");
	
	}

}
